﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Experiment5
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            frmLogin login = new frmLogin();
            if (login.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                toolStripStatusLabel1.Text = "当前登录用户为：" + login.txtName.Text;
                login.Dispose();
            }
            else
            {
                login.Dispose();
                this.Dispose();
            }

        }

        private void 子窗口ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MdiChild frmmdi = new MdiChild();
            frmmdi.MdiParent = this;
            frmmdi.Show();

        }

        private void 模式窗口ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogForm frmdf = new DialogForm();
            frmdf.ShowDialog();

        }

        private void 非模式窗口ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SingleForm frmSf = new SingleForm();
            frmSf.Show();

        }
    }
}
